/*
 * SaleBO.java
 *
 * Created on March 5, 2007, 8:07 PM
 *
 * Stores information about a coupon, which is applied to a revenue source
 * contained on a transaction line.  This object contains the relevant
 * revenue source ID, the amount or percentage of the coupon, the start and
 * expiration dates, and a description of the coupon.
 */

package edu.byu.isys413.mystuff.sales;

import edu.byu.isys413.mystuff.revaBO;

/**
 *
 * @author Gabe
 */
public class SalesBO extends revaBO {
    
    private int quantity;
    private ProductBO product;
    private boolean returnLine;
    private boolean dirty = false;   
    private boolean alreadyInDatabase = false;
    
    /** Creates a new instance of SaleBO */
    SalesBO() {
//        this.setReturnLine(false);
//        this.setType("sale");
//        this.setIsDirty(true);
    }
    
    
    
    /** Creates a new instance of TransactionBO with an ID*/
    SalesBO(String revSrcID) {
//        this.setType("sale");
//        setRevSrcID(revSrcID);
//        this.setIsDirty(true);
    }

    /* Returns the sale quantity (if the coupon is for
     * a certain dollar amount discount).
     */
    public int getQuantity() {
        return this.quantity;
    }
    
    /* Sets the coupon amount (if the coupon is for
     * a certain dollar amount discount).
     */
    public void setQuantity(int qty) {
        setDirty(true);
        this.quantity = qty;
    }

    public ProductBO getProduct() {
        return product;
    }

    public void setProduct(ProductBO product) {
        this.product = product;
        this.setDirty(true);
    }

    public boolean getReturnLine() {
        return returnLine;
    }

    public void setReturnLine(boolean returnLine) {
        this.returnLine = returnLine;
        this.setDirty(true);
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }

    public boolean isAlreadyInDatabase() {
        return alreadyInDatabase;
    }

    public void setAlreadyInDatabase(boolean alreadyInDatabase) {
        this.alreadyInDatabase = alreadyInDatabase;
    }
}
